/*********************************************************
* Multi-Page Interface
* Version: 1.2
* Date: September 2, 2003
* Author: Michal Mecinski
* E-mail: mimec@mimec.w.pl
* WWW: http://www.mimec.w.pl
*
* You may freely use and modify this code, but don't remove
* this copyright note.
*
* There is no warranty of any kind, express or implied, for this class.
* The author does not take the responsibility for any damage
* resulting from the use of it.
*
* Let me know if you find this code useful, and
* send me any modifications and bug reports.
*
* Copyright (C) 2003 by Michal Mecinski
*********************************************************/

#pragma once

class CDualSplitWnd;

// extended create context
struct CMPICreateContext : public CCreateContext
{
	int* m_pSplitData;
	DWORD m_dwViewParam;
};

// don't use these constants directly
// use the MPI_ macros from MPIDocTemplate.h
#define MPIT_VIEW		0
#define MPIT_HSPLIT		1
#define MPIT_VSPLIT		2
#define MPIT_TABS		3
#define MPIT_END		100

#define MPIS_BAR_LEFT	-1
#define MPIS_BAR_RIGHT	-2
#define MPIS_BAR_TOP	-1
#define MPIS_BAR_BOTTOM	-2

#define MPIBS_AUTO		-1


class CMPIChildFrame : public CMDIChildWnd
{
	DECLARE_DYNCREATE(CMPIChildFrame)
public:
	CMPIChildFrame();

public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void ActivateFrame(int nCmdShow = -1);
	virtual void OnUpdateFrameMenu(BOOL bActivate, CWnd* pActivateWnd, HMENU hMenuAlt);
protected:
	virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
	virtual void OnUpdateFrameTitle(BOOL bAddToTitle);

public:
	CSplitterWnd* GetSpliterPtr(INT iPos);
	virtual ~CMPIChildFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	// Recursive function for creating splitters and views
	BOOL CreateClientHelper(int& nPos, CWnd* pParent, int nID, CMPICreateContext* pContext);

protected:
	// Automatically created splitter windows
	CTypedPtrList<CPtrList, CSplitterWnd*> m_listSplitters;

protected:
	afx_msg void OnClose();
	DECLARE_MESSAGE_MAP()
};

